local rewards = require 'core_webber_the_trainer/data/webbert_soul_buy_items'
local totoal_buy_items = #rewards -- 商品目前总数
local MAX_LOW_VALUE = 65535

---@class replica_components
---@field webbert_soul replica_webbert_soul

---@class replica_webbert_soul
---@field inst ent
---@field soul_high netvar
---@field soul_low netvar
local webbert_soul = Class(
---@param self replica_webbert_soul
---@param inst ent
function(self, inst)
    self.inst = inst
    self.soul_high = net_ushortint(inst.GUID, "webbert_soul.soul_high",'webbert_soul_soul_num_change')
    self.soul_low = net_ushortint(inst.GUID, "webbert_soul.soul_low",'webbert_soul_soul_num_change')
    for i=1,totoal_buy_items do
        self['buy_times_'..i] = net_ushortint(inst.GUID, "webbert_soul.buy_times_"..i,'webbert_soul_buy_times_change_'..i)
    end
end)

function webbert_soul:GetSoul()
    local _max_low_value = MAX_LOW_VALUE
    return self.soul_high:value() * (_max_low_value + 1) + self.soul_low:value()
end


return webbert_soul